package com.fate.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fate.domain.SysLoginUser;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SysLoginUserMapper extends BaseMapper<SysLoginUser> {


    /**
     * 查权限
     * @param userId
     * @return
     */
    @Select("select DISTINCT t1.perms from sys_menu as t1 join sys_role_menu as t2 on(t1.menu_id = t2.menu_id) join sys_user_role as t3 on(t2.role_id = t3.role_id)\n" +
            "where t3.user_id = 1 AND( t1.type =1 or t1.type=2)")
    List<String> findAuthById(Long userId);
}